<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>添加问卷</title>

	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/default.css" />
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/js/easyui/themes/default/easyui.css" />
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/js/easyui/themes/icon.css" />
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/easyui/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/page/questionnaire/questionnaire.js"></script>
    <style type="text/css">
    .btnSpan{
		cursor:pointer;
		background:#00BBFF;
		padding: 5px 13px 5px 8px;
		border-radius: 5px;
		border: 1px solid #efefef;
		display: block;
		float: left;
		line-height: 10px;
		position: relative;
		
	}
	.btnSpan .close{
		position:absolute; 
		display:none; 
		right:2px; 
		top:3px; 
		font-style:normal;
		font-family: arial; 
		font-size: 12px; 
		line-height:10px; 
		padding: 3px;  
		width: 5px; 
		height: 5px; 
		line-height: 5px; 
		cursor: pointer; 
	}
	.btnSpan:hover .close{ display: block;}
    </style>
</head>
<body>
<div>
	<div class="easyui-panel" style="padding:3px;margin-top: 3px;" >
		<a href="javascript:saveQuestionnaire();"  class="easyui-linkbutton" data-options="toggle:true,plain:true,selected:true,iconCls:'icon-save'">保存</a>
		<a href="javascript:publishQuestionnaire();" class="easyui-linkbutton" data-options="toggle:true,plain:true,selected:true,iconCls:'icon-ok'">保存并发布</a>
		<a href="javascript:viewQuestionnaire();" class="easyui-linkbutton" data-options="toggle:true,plain:true,selected:true,iconCls:'icon-man'">预览</a>
		<a href="javascript:goback();" class="easyui-linkbutton" data-options="toggle:true,plain:true,selected:true,iconCls:'icon-back'">返回</a>
	</div>
	<div id="panelAddQeustionnaire" class="easyui-panel" title="添加新问卷"  style="padding:10px;">
		<form id="frmQuestionnaireAdd" method="post">
		<input  type="hidden" id="txtAddQuestionnaireId" name="id" value="${questionnaireBean.id }"/>
		<table>
			<tr>
				<td>问卷标题：</td>
				<td>
					<input id="txtAddTitle" class="easyui-textbox" type="text"  name="title" data-options="required:true" style="width:350px" value="${questionnaireBean.title }"/>
				</td>
			</tr>
			<tr>
				<td>是否定时推送：</td>
				<td>
					<select id="ccAutoSend" class="easyui-combobox" name="autoSend" style="width:150px;" data-options="onSelect:autoSendSel">   
					    <option value="0" <c:if test="${questionnaireBean.autoSend==0 }">selected="selected"</c:if>>不定时推送</option>
					    <option value="1" <c:if test="${questionnaireBean.autoSend==1 }">selected="selected"</c:if>>定时推送</option>     
					</select>
					<span style="color:#AAAAAA;margin-left: 10px;">
						定时推送表示人流术后隔多长时间推送后续的问卷。
					</span>
				</td>
			</tr>
			<tr id="trAutoSendYes"  <c:if test="${questionnaireBean.autoSend!=1 }">style="display: none;"</c:if>>
				<td>间隔时间：</td>
				<td>
					<input type="txtSendCycleVal" class="easyui-numberbox" name="sendCycleVal" value="${questionnaireBean.sendCycleVal }" data-options="min:0,precision:0" style="width:75px;"/>  
					<select id="ccSendCycle" class="easyui-combobox" name="sendCycle" style="width:70px;">   
					    <option value="1" <c:if test="${questionnaireBean.sendCycle==1 }">selected="selected"</c:if>>日</option>
					    <option value="2" <c:if test="${questionnaireBean.sendCycle==2 }">selected="selected"</c:if>>周</option>
					    <option value="3" <c:if test="${questionnaireBean.sendCycle==3 }">selected="selected"</c:if>>月</option>  
					    <option value="4" <c:if test="${questionnaireBean.sendCycle==4 }">selected="selected"</c:if>>年</option> 
					</select>
				</td>
			</tr>
			<tr>
				<td>简要说明：</td>
				<td>
					<input id="txtAddDescription" name="description" class="easyui-textbox" type="text" data-options="multiline:true" style="width:350px;height:100px;" value="${questionnaireBean.description }">
				</td>
			</tr>
		</table>
		</form>
	</div>
	<div class="easyui-panel" title="所属医院">
		<table id="gridQuestionnaireHospital" >
			<thead>
				<tr>
					<th data-options="field:'hospitalName',width:200">医院名称</th>
					<th data-options="field:'id',width:100,formatter:optHospitalColumn" align="center">操作</th>
				</tr>
			</thead>
		</table>
	</div>
	<div class="easyui-panel" title="设置问题项">
		<table id="gridQuestionOptions" >
			<thead>
				<tr>
					<th data-options="field:'type',width:100,formatter:typeColumn">题型</th>
					<th data-options="field:'description',width:300">问题描述</th>
					<th data-options="field:'upload',width:100,formatter:upColumn">是否需要上传文件</th>
					<th data-options="field:'id',formatter:optColumn" align="center">操作</th>
				</tr>
			</thead>
		</table>
	</div>
</div>

<!-- 工具栏-start -->
<div id="tbQuestions" style="padding:5px;height:auto">
	<div style="margin-bottom:5px">
		<div style="float: left;">
			<a href="javascript:void(0)" onclick="openWinQuestion()" class="easyui-linkbutton" data-options="iconCls:'icon-add'" plain="true" title="添加"></a>
		</div>
		<div class="datagrid-btn-separator" style="margin-left: 5px;float: left;margin-right: 15px;"></div>
		<input class="easyui-textbox" id="txtSearchTitle" style="width:120px" data-options="prompt:'请输入问卷标题'" />
		<a href="javascript:searchQuestionnaire();" class="easyui-linkbutton" data-options="iconCls:'icon-search'" >查询</a>
	</div>
</div>
<!-- 工具栏-end -->

<!-- 问题编辑对话框-start -->
<input id="editQuestionId" type="hidden" value="">
<div id="winQuestion" class="easyui-window" title="设置问题" data-options="modal:true,closed:true,minimizable:false,maximizable:false,collapsible:false" style="width:550px;height:330px;padding:1px;">
	<div id="tabquestion" class="easyui-tabs" style="width:534px;height:292px;">   
	    <div title="单选" style="padding:20px;" data-options="fit:true">
	    	<form id="frmQuestionSingleSelect" method="post">
	    		<input id="OpTypeSingle" type="hidden" value="add">
	    		<table>
	    			<tr>
	    				<td>是否上传附件</td>
	    				<td>
	    					<input id="txtUpload_yes" name="txtUpload" type="radio" value="0">是
	    					<input id="txtUpload_no" name="txtUpload" type="radio" value="1" checked="checked">否
	    				</td>
	    			</tr>
	    			<tr>
	    				<td>问题描述：</td>
	    				<td><input id="txtQuestionSSelDesc" class="easyui-textbox"  style="width:400px"> </td>
	    			</tr>
	    			<tr style="border-top: 1px;border-top-color: black;">
	    				<td>问题选项</td>
	    				<td id="tdQuestionSingleSelectOption" >
		    				<div style="margin-top: 5px;">
			        			<input id="txtQuestionSSel0" name="txtQuestionSSel" class="easyui-textbox"  style="width:300px"> 
			        		</div>
			        		<div style="margin-top: 5px;">
			        			<input id="txtQuestionSSel1" name="txtQuestionSSel" class="easyui-textbox"  style="width:300px"> 
			        		</div>
			        		<div style="margin-top: 5px;">
			        			<input id="txtQuestionSSel2" name="txtQuestionSSel" class="easyui-textbox"  style="width:300px"> 
			        		</div>
			        		<div style='margin-top: 5px;'>
			        			<input id="txtQuestionSSel3" name='txtQuestionSSel' class='easyui-textbox'  style='width:300px'>
			        			<span style='color: red;font-size: 20px;cursor: pointer;' onclick='addQuestionSSel()'>＋</span>
			        		</div>
	    				</td>
	    			</tr>
	    		</table> 
	        </form> 
	        <div style="width: 100%;margin-top: 10px;" align="center">
	        	<a id="btnSaveQuestionSingleSelect" href="javascript:void(0)" onclick="saveQuestionSingleSelect()" class="easyui-linkbutton" >保存</a>  
	        </div>  
	    </div>   
	    <div title="多选"  style="overflow:auto;padding:20px;">   
	        <form id="frmQuestionMultiSelect" method="post">
	        	<input id="OpTypeMulti" type="hidden" value="add">
	    		<table>
	    			<tr>
	    				<td>是否上传附件</td>
	    				<td>
	    					<input id="txtMUpload_yes" name="txtMUpload" type="radio" value="0">是
	    					<input id="txtMUpload_no" name="txtMUpload" type="radio" value="1" checked="checked">否
	    				</td>
	    			</tr>
	    			<tr>
	    				<td>问题描述：</td>
	    				<td><input id="txtQuestionMSelDesc" class="easyui-textbox"  style="width:400px"> </td>
	    			</tr>
	    			<tr style="border-top: 1px;border-top-color: black;">
	    				<td>问题选项</td>
	    				<td id="tdQuestionMultiSelectOption" >
		    				<div style="margin-top: 5px;">
			        			<input id="txtQuestionMSel0" name="txtQuestionMSel" class="easyui-textbox"  style="width:300px"> 
			        		</div>
			        		<div style="margin-top: 5px;">
			        			<input id="txtQuestionMSel1" name="txtQuestionMSel" class="easyui-textbox"  style="width:300px"> 
			        		</div>
			        		<div style="margin-top: 5px;">
			        			<input id="txtQuestionMSel2" name="txtQuestionMSel" class="easyui-textbox"  style="width:300px"> 
			        		</div>
			        		<div style="margin-top: 5px;">
			        			<input id="txtQuestionMSel3" name='txtQuestionMSel' class='easyui-textbox'  style='width:300px'> 
			        			<span style='color: red;font-size: 20px;cursor: pointer;' onclick=addQuestionMSel()>＋</span>
			        		</div>
	    				</td>
	    			</tr>
	    		</table> 
	        </form> 
	        <div style="width: 100%;margin-top: 10px;" align="center">
	        	<a id="btnSaveQuestionMutiSelect" href="javascript:void(0)" onclick="saveQuestionMutiSelect()" class="easyui-linkbutton" >保存</a>  
	        </div>     
	    </div>   
	    <div title="问答"  style="padding:20px;">   
	       <form id="frmQuestionInterlocution" method="post">
	       		<input id="OpTypeInterlocution" type="hidden" value="add">
	    		<table>
	    			<tr>
	    				<td>是否上传附件</td>
	    				<td>
	    					<input id="txtIUpload_yes" name="txtIUpload" type="radio" value="0">是
	    					<input id="txtIUpload_no" name="txtIUpload" type="radio" value="1" checked="checked">否
	    				</td>
	    			</tr>
	    			<tr>
	    				<td>问题描述：</td>
	    				<td>
	    					<input id="txtQuestionIDesc" class="easyui-textbox"  style="width:400px;height: 100px;" data-options="multiline:true"> 
	    				</td>
	    			</tr>
	    		</table> 
	        </form> 
	        <div style="width: 100%;margin-top: 10px;" align="center">
	        	<a id="btnSaveQuestionInterlocution" href="javascript:void(0)" onclick="saveQuestionInterlocution()" class="easyui-linkbutton" >保存</a>  
	        </div> 
	    </div>   
	</div> 
</div>
<!-- 问题编辑对话框-start -->

<!-- 选择医院工具栏-start -->
<div id="tbQuestionsHospital" style="padding:1px;height:auto">
	<a href="javascript:void(0)" onclick="openWinHospitalSel()" class="easyui-linkbutton" data-options="iconCls:'icon-add'" plain="true" title="添加"></a>
</div>
<!-- 选择医院工具栏-end -->

<!-- 选择医院对话框-start -->
<div id="dlgQuestionnaireHospital" class="easyui-dialog" title="选择医院" data-options="modal:true,closed:true" style="width:530px;height:420px;padding:5px;">
	<div class="easyui-layout" data-options="fit:true">
		<div data-options="region:'center'" style="padding:10px;">
			<table id="gridHospital" style="width: 450px;">
				<thead>
					<tr>
						<th data-options="field:'id',width:40,formatter:checkColumn" align="center">选择</th>
						<th data-options="field:'name',width:100">姓名</th>
					</tr>
				</thead>
			</table>
			<div class="easyui-panel" style="margin-top: 5px;width: 450px;padding: 3px;height: 80px;line-height: 80px;">
			<div id="divCheckedMember"></div>
			</div>
		</div>
		<div data-options="region:'south',border:false" style="text-align:center;padding:5px 0 0;">
			<a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:checkMember();" style="width:80px">确定</a>
			<a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:dlgWinHospitalCancel();" style="width:80px">取消</a>
		</div>
	</div>
</div>
<!-- 选择医院对话框-end -->

</body>
</html>